/* Monitor.hh -- Monitora a posição dos objetos em campo
 *
 * Copyright (C) 2008, Diogo F. S. Ramos <diogo.ramos@usp.br>
 * GEAR - Grupo de Estudos Avançados em Robótica
 * <http://www.sel.eesc.usp.br/gear>
 *
 * This file is part of GEARMedula.
 * 
 * GEARMedula is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, version 3 of the
 * License.
 * 
 * GEARMedula is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see
 * <http://www.gnu.org/licenses/>.
 */

#ifndef MONITOR_HH_
#define MONITOR_HH_

#include <vector>

#include "XError.hh"
#include "GMSim.hh"

class Monitor
{
    int f_real_;

    /* Informações do mundo */
    std::vector<float> world;
    pthread_mutex_t world_mutex;

    /* Informações dos objetos em campo */
    std::vector<float> field;
    pthread_mutex_t field_mutex;

    XError xerror;
    GMSim * sim_;
public:
    Monitor();
    ~Monitor();
    void Init( const int f_real );
    void setSim( GMSim * sim );
    void setWorld( const std::vector<float> world_vec );
    void getWorld( std::vector<float> &world_vec );
    void setField( const std::vector<float> field_vec );
    void getField( std::vector<float> &field_vec );
};

#endif	/* MONITOR_HH_ */
